package com.yiren.backstage.currency.entity;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.ToOne;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.DaoException;
import com.yiren.backstage.db.dao.DaoSession;
import com.yiren.backstage.db.dao.StateMonitorEntityDao;
import com.yiren.backstage.db.dao.MonitorCountEntityDao;

/**
 * Time:2021/11/03 9:33
 * Author:xiaozan
 * Description:状态监控 实体类
 */
@Entity(nameInDb = "monitor_count", createInDb = false)
public class MonitorCountEntity {

    @Id
    private String id;

    private String state_monitor_id;
    @ToOne(joinProperty = "state_monitor_id")
    private StateMonitorEntity stateMonitorEntity;

    /**逻辑连接词. 对应 LogicConnectiveEnum*/
    private String logicConnective;
    /**关系运算符. 对应 RelationalOperatorEnum*/
    private String relationalOperator;
    /**监控车辆状态. 对应 CarStateNameEnum*/
    private String carStateName;
    /**监控参数值*/
    private String value;
    /**监控参数最小值*/
    private String minValue;
    /**监控参数最大值*/
    private String maxValue;

    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;

    /** Used for active entity operations. */
    @Generated(hash = 643274847)
    private transient MonitorCountEntityDao myDao;
    @Generated(hash = 1397949500)
    public MonitorCountEntity(String id, String state_monitor_id,
            String logicConnective, String relationalOperator, String carStateName,
            String value, String minValue, String maxValue) {
        this.id = id;
        this.state_monitor_id = state_monitor_id;
        this.logicConnective = logicConnective;
        this.relationalOperator = relationalOperator;
        this.carStateName = carStateName;
        this.value = value;
        this.minValue = minValue;
        this.maxValue = maxValue;
    }
    @Generated(hash = 1500456788)
    public MonitorCountEntity() {
    }
    public String getId() {
        return this.id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getState_monitor_id() {
        return this.state_monitor_id;
    }
    public void setState_monitor_id(String state_monitor_id) {
        this.state_monitor_id = state_monitor_id;
    }
    public String getLogicConnective() {
        return this.logicConnective;
    }
    public void setLogicConnective(String logicConnective) {
        this.logicConnective = logicConnective;
    }
    public String getRelationalOperator() {
        return this.relationalOperator;
    }
    public void setRelationalOperator(String relationalOperator) {
        this.relationalOperator = relationalOperator;
    }
    public String getCarStateName() {
        return this.carStateName;
    }
    public void setCarStateName(String carStateName) {
        this.carStateName = carStateName;
    }
    public String getValue() {
        return this.value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    public String getMinValue() {
        return this.minValue;
    }
    public void setMinValue(String minValue) {
        this.minValue = minValue;
    }
    public String getMaxValue() {
        return this.maxValue;
    }
    public void setMaxValue(String maxValue) {
        this.maxValue = maxValue;
    }
    @Generated(hash = 485571722)
    private transient String stateMonitorEntity__resolvedKey;
    /** To-one relationship, resolved on first access. */
    @Generated(hash = 1894669979)
    public StateMonitorEntity getStateMonitorEntity() {
        String __key = this.state_monitor_id;
        if (stateMonitorEntity__resolvedKey == null
                || stateMonitorEntity__resolvedKey != __key) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            StateMonitorEntityDao targetDao = daoSession.getStateMonitorEntityDao();
            StateMonitorEntity stateMonitorEntityNew = targetDao.load(__key);
            synchronized (this) {
                stateMonitorEntity = stateMonitorEntityNew;
                stateMonitorEntity__resolvedKey = __key;
            }
        }
        return stateMonitorEntity;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1129726008)
    public void setStateMonitorEntity(StateMonitorEntity stateMonitorEntity) {
        synchronized (this) {
            this.stateMonitorEntity = stateMonitorEntity;
            state_monitor_id = stateMonitorEntity == null ? null
                    : stateMonitorEntity.getId();
            stateMonitorEntity__resolvedKey = state_monitor_id;
        }
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1478474478)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getMonitorCountEntityDao() : null;
    }

}
